# Makefile: SMQ ----------------------------------------------------------------

# Copyright (c) 2010- Peter Bui and Aaron Dingler.
# This software is distributed under the GNU General Public License.
# See the file COPYING for details.

include ../Makefile.common

# Compiler and Linker Flags ----------------------------------------------------

LINKLIBS = -lsmq -ldttools 

# Include and Library Paths ----------------------------------------------------

CCTOOLS = ../contrib/cctools

INCPATH	= -I$(CCTOOLS)
LIBPATH	= -L$(CCTOOLS)

# Specific Targets and Objects -------------------------------------------------

SMQ_LIB_SRC = smq_catalog.c smq_client.c smq_message.c smq_util.c
SMQ_LIB_OBJ = $(SMQ_LIB_SRC:.c=.o)
SMQ_LIB_TGT = libsmq.a

SMQ_MGR_SRC = smq_manager.c smq_exchange.c smq_message_queue.c
SMQ_MGR_OBJ = $(SMQ_MGR_SRC:.c=.o)
SMQ_MGR_TGT = smq_manager

SMQ_CRE_SRC = smq_create.c 
SMQ_CRE_OBJ = $(SMQ_CRE_SRC:.c=.o)
SMQ_CRE_TGT = smq_create

SMQ_PUT_SRC = smq_put.c 
SMQ_PUT_OBJ = $(SMQ_PUT_SRC:.c=.o)
SMQ_PUT_TGT = smq_put

SMQ_BND_SRC = smq_bind.c 
SMQ_BND_OBJ = $(SMQ_BND_SRC:.c=.o)
SMQ_BND_TGT = smq_bind

SMQ_UNB_SRC = smq_unbind.c 
SMQ_UNB_OBJ = $(SMQ_UNB_SRC:.c=.o)
SMQ_UNB_TGT = smq_unbind

SMQ_BNS_SRC = smq_bindings.c 
SMQ_BNS_OBJ = $(SMQ_BNS_SRC:.c=.o)
SMQ_BNS_TGT = smq_bindings

SMQ_LST_SRC = smq_list.c 
SMQ_LST_OBJ = $(SMQ_LST_SRC:.c=.o)
SMQ_LST_TGT = smq_list

SMQ_FLS_SRC = smq_flush.c 
SMQ_FLS_OBJ = $(SMQ_FLS_SRC:.c=.o)
SMQ_FLS_TGT = smq_flush

SMQ_STA_SRC = smq_status.c 
SMQ_STA_OBJ = $(SMQ_STA_SRC:.c=.o)
SMQ_STA_TGT = smq_status

SMQ_GET_SRC = smq_get.c 
SMQ_GET_OBJ = $(SMQ_GET_SRC:.c=.o)
SMQ_GET_TGT = smq_get

SMQ_TARGETS = $(SMQ_LIB_TGT) $(SMQ_MGR_TGT) $(SMQ_CRE_TGT) $(SMQ_PUT_TGT) $(SMQ_GET_TGT) $(SMQ_BND_TGT) $(SMQ_UNB_TGT) $(SMQ_STA_TGT) $(SMQ_BNS_TGT) $(SMQ_LST_TGT) $(SMQ_FLS_TGT)

# Target Specifications --------------------------------------------------------

$(SMQ_LIB_TGT): $(SMQ_LIB_OBJ)
	@$(call LINK_MSG,AR,$(RELPATH)$@)
	@$(AR) $(SMQ_ARFLAGS) $@ $^

$(SMQ_MGR_TGT): $(SMQ_MGR_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_MGR_OBJ) $(SMQ_LINKLIBS)

$(SMQ_CRE_TGT): $(SMQ_CRE_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_CRE_OBJ) $(SMQ_LINKLIBS)

$(SMQ_PUT_TGT): $(SMQ_PUT_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_PUT_OBJ) $(SMQ_LINKLIBS)

$(SMQ_BND_TGT): $(SMQ_BND_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_BND_OBJ) $(SMQ_LINKLIBS)

$(SMQ_UNB_TGT): $(SMQ_UNB_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_UNB_OBJ) $(SMQ_LINKLIBS)

$(SMQ_BNS_TGT): $(SMQ_BNS_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_BNS_OBJ) $(SMQ_LINKLIBS)

$(SMQ_LST_TGT): $(SMQ_LST_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_LST_OBJ) $(SMQ_LINKLIBS)

$(SMQ_FLS_TGT): $(SMQ_FLS_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_FLS_OBJ) $(SMQ_LINKLIBS)

$(SMQ_STA_TGT): $(SMQ_STA_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_STA_OBJ) $(SMQ_LINKLIBS)

$(SMQ_GET_TGT): $(SMQ_GET_OBJ) $(SMQ_LIB_TGT)
	@$(call LINK_MSG,LINK,$(RELPATH)$@)
	@$(CC) -o $@ $(SMQ_LINKFLAGS) $(SMQ_GET_OBJ) $(SMQ_LINKLIBS)

# Autogenerated Dependencies ---------------------------------------------------

# DEPENDENCIES

smq_catalog.o: smq_catalog.c smq_common.h ../contrib/cctools/debug.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/catalog_query.h ../contrib/cctools/nvpair.h \
 ../contrib/cctools/catalog_server.h
smq_client.o: smq_client.c smq_common.h ../contrib/cctools/debug.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h
smq_create.o: smq_create.c smq_common.h smq_catalog.h \
 ../contrib/cctools/link.h ../contrib/cctools/int_sizes.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_exchange.o: smq_exchange.c smq_common.h smq_message.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/list.h \
 smq_message_queue.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/create_dir.h \
 ../contrib/cctools/debug.h ../contrib/cctools/hash_table.h \
 ../contrib/cctools/sort_dir.h ../contrib/cctools/stringtools.h \
 ../contrib/cctools/xmalloc.h
smq_manager.o: smq_manager.c smq_common.h smq_exchange.h smq_message.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/list.h \
 smq_message_queue.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/catalog_server.h \
 ../contrib/cctools/change_process_title.h ../contrib/cctools/datagram.h \
 ../contrib/cctools/debug.h ../contrib/cctools/domain_name_cache.h \
 ../contrib/cctools/domain_name.h ../contrib/cctools/sort_dir.h \
 ../contrib/cctools/stringtools.h ../contrib/cctools/username.h \
 ../contrib/cctools/xmalloc.h
smq_message.o: smq_message.c smq_common.h smq_message.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/list.h \
 ../contrib/cctools/debug.h ../contrib/cctools/int_sizes.h \
 ../contrib/cctools/stringtools.h ../contrib/cctools/xmalloc.h
smq_message_queue.o: smq_message_queue.c smq_common.h smq_message.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/list.h \
 smq_message_queue.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h smq_util.h \
 ../contrib/cctools/create_dir.h ../contrib/cctools/debug.h \
 ../contrib/cctools/sort_dir.h ../contrib/cctools/stringtools.h
smq_put.o: smq_put.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_bind.o: smq_bind.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_unbind.o: smq_unbind.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_bindings.o: smq_bindings.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_list.o: smq_list.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_flush.o: smq_flush.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_status.o: smq_status.c smq_common.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_get.o: smq_get.c smq_common.h smq_client.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h ../contrib/cctools/debug.h
smq_util.o: smq_util.c smq_util.h ../contrib/cctools/int_sizes.h
test_catalog.o: test_catalog.c smq_catalog.h ../contrib/cctools/link.h \
 ../contrib/cctools/int_sizes.h smq_common.h

# vim: sts=4 sw=4 ts=8 ft=make
